#include <iostream>
#include "data/ByteBuf.h"

using namespace std;

int main()
{
    std::cout.setf(std::ios_base::boolalpha);

    string str;
    str.push_back(0x0A);
    str.push_back(0x12);
    str.push_back(0x34);
    sh::ByteBuf byteBuf(str);
    cout << byteBuf.toHexString(sh::Case::Upper, " ") << endl;

    sh::ByteBuf buf = sh::ByteBuf::fromHex("0b0c1323");
    cout << buf.toHexString(sh::Case::Upper, " ") << endl;
    cout << buf.readableBytes() << endl;
    cout << buf.getShort(0) << endl;
    cout << buf.readableBytes() << endl;
    cout << buf.readChar() << endl;
    cout << buf.readableBytes() << endl;

    return 0;
}
